#include <vector>
#include <string>

std::vector<std::string> operators;

void init_list_of_operators()
{
    operators.push_back("^");       //precedence: 1
    operators.push_back("*");       //precedence: 2
    operators.push_back("/");       //precedence: 2
    operators.push_back("\\");      //precedence: 2
    operators.push_back("MOD");     //precedence: 2
    operators.push_back("+");       //precedence: 3
    operators.push_back("-");       //precedence: 3
    operators.push_back("<");       //precedence: 4
    operators.push_back("<=");      //precedence: 4
    operators.push_back(">");       //precedence: 4
    operators.push_back(">=");      //precedence: 4
    operators.push_back("=");       //precedence: 5
    operators.push_back("<>");      //precedence: 5
    operators.push_back("AND");     //precedence: 6
    operators.push_back("OR");      //precedence: 7
    operators.push_back("XOR");     //precedence: 8
}

std::vector<std::string> get_list_of_operators()
{
    return operators;
}

std::vector<std::string> get_operators_at_precedence(uint_fast8_t precedence_level)
{
    std::vector<std::string> ret;

    switch(precedence_level)
    {
        case 1:
            ret.push_back("^");
            break;
        case 2:
            ret.push_back("*");
            ret.push_back("/");
            ret.push_back("\\");
            ret.push_back("MOD");
            break;
        case 3:
            ret.push_back("+");
            ret.push_back("-");
            break;
        case 4:
            ret.push_back("<");
            ret.push_back("<=");
            ret.push_back(">");
            ret.push_back(">=");
            break;
        case 5:
            ret.push_back("=");
            ret.push_back("<>");
            break;
        case 6:
            ret.push_back("AND");
            break;
        case 7:
            ret.push_back("OR");
            break;
        case 8:
            ret.push_back("XOR");
            break;
        default:
            ret.clear();
    }

    return ret;
}

uint_fast8_t get_number_of_precedences()
{
    return 8;
}
